﻿using System;
using System.IO;

namespace LabSolutions
{
    class Program
    {
        static int Main()
        {
            string input = Console.ReadLine();
           double x = 0;

try
{
            x = double.Parse(input);
}
catch
{
	Console.WriteLine("Неверный формат данных");
	return 1;
}


            double z1 = (x * x + 2 * x - 3 + (x + 1) * Math.Sqrt(x * x - 9)) / (x * x - 2 * x - 3 + (x - 1) * Math.Sqrt(x * x - 9));
            double z2 = Math.Sqrt((x + 3) / (x - 3));

                Console.WriteLine(z1.ToString("0.00000"));
                Console.Write(z2.ToString("0.00000"));           

	return 0;
        }
    }
}
